package com.example.demo2.web.controller;

import com.example.demo2.model.dtos.QueryDto;
import com.example.demo2.model.vos.HotelPageVo;
import com.example.demo2.service.HotelService;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private HotelService hotelService;

    @PostMapping("/search")
    public HotelPageVo search(@RequestBody QueryDto queryDto) throws IOException {

        return hotelService.search(queryDto);
    }
}
